package com.jwsoft.manager.common.enums.demo;
/**
 * 测试枚举
 *
 * @author chenzh
 * @date 2020-09-28
 * */
public enum DemoEnum {
    test1("1","测试1"),
    test2("2","测试2");
    private String type;
    private String name;

    DemoEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }

    public static DemoEnum getByType(String type) {

        for (DemoEnum typeEnum : values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
